writeToFileAtomically

abstract override fun writeToFileAtomically(bytesToWrite: ByteArray, destinationFilename: String)

Encrypts and writes to a local data file atomically. The given data is saved to the file atomically. That is, it does everything possible to ensure the write will succeed before actually changing the target file. Any IO exceptions should be thrown before the target file is touched. If filename is a relative path (which it should be) it will be based on the safe root of the data folder.